PSS-ex42.mws Power Series Solution
example 42:
> | restart; |
> | c[0]; |
> | c[1]; |
> | c[2]:=0; |
> | c[3]:=0; |
define the number of terms in partial summation:
> | M:=11; |
recursion formula:
> | for m from 0 to M do c[m+4]:=c[m]/(m+3)/(m+4) od; |
> | m:='m': |
Partial sum of Solution:
> | y(x):=sum(c[m]*x^m,m=0..M); |
> | y(x):=sort(y(x),c[0]); |
> | y(x):= collect(y(x),{c[0],c[1]}); |
Family of solution curves for different values of coefficients c[0] and c[1]
> | f:=subs({c[0]=i/2,c[1]=j/2},y(x)): |
> | f:={seq(seq(f,i=-4..4),j=-4..4)}: |
> | plot(f,x=-2..2,y=-4..4,color=black); |
Initial Value Problem: y(0)=1, y'(0)=0.5
> | subs(x=0,y(x)); |
> | subs(c[0]=1,y(x)); |
> | diff(%,x); |
> | subs(x=0,%); |
> | Y(x):=subs({c[0]=1,c[1]=0.5},y(x)); |
> | plot(Y(x),x=-2..2,y=-1..4); |